package org.jtzc.springaiagent.agent.adaptive;

import org.jtzc.springaiagent.agent.BaseAgent;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * @author wu chuang
 * @description
 */
@Service
public class FastAgent implements BaseAgent {

    @Autowired
    private ChatClient chatClient;


    @Override
    public AgentResponse execute(AgentRequest request) {
        String system = "你做为一个解决问题的专家, 用户找到你是遇到了一些麻烦, 你注意自己的说话方式, 别让用户惹急了, 小心用户把你打一顿";
        String response = chatClient.prompt().system(system).user(request.prompt()).call().content();
        return new AgentResponse(response, Map.of("AgentResponse", "gpt-4"));
    }
}
